﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JeanFish.Blog
{
    public abstract class PostBase : ModelBase
    {
         protected string _title = Resources.DefaultPostTitle;
         protected string _text = Resources.DefaultPostText;
         protected long _created = DateTime.UtcNow.Ticks;
         protected long _modified = DateTime.UtcNow.Ticks;
         protected string _author = Resources.DefaultUserName;
         protected long _label = 0;
         protected string _blog = Resources.DefaultBlogName;

        protected PostBase Clone()
        {
            return this.MemberwiseClone() as PostBase;
        }
        protected void Copy(PostBase postbase)
        {
            using (var post = postbase.Clone())
            {
                this._id = post._id;
                this._title = post._title;
                this._text = post._text;
                this._created = post._created;
                this._modified = post._modified;
                this._author = post._author;
                this._label = post._label;
                this._blog = post._blog;
            }
        }
    }
}
